#include<iostream>

using namespace std;

class intArray {
public:
    intArray(int size);

    intArray(const intArray &x);

    ~intArray();

    bool set(int i, int elem);

    bool get(int i, int &elem);

    int length() const;

    void reSize(int size);

    void print();

private:
    int *elements;
    int arraysize;
};

intArray::intArray(int size) {
    if (size <= 0) {
        cerr << "Invalid Array Size" << endl;
        return;
    }
    elements = new int[size];
    if (elements == NULL) {
        cerr << "Memory Allocation Error" << endl;
        return;
    } else arraysize = size;
}

intArray::intArray(const intArray &x) {
    int n = arraysize = x.arraysize;
    elements = new int[n];
    if (elements == NULL)
        cerr << "Memory Allocation Error" << endl;
    int *srcptr = x.elements;
    int *destptr = elements;
    while (n--)
        *destptr++ = *srcptr++;
}

intArray::~intArray() { delete[]elements; }

bool intArray::set(int i, int elem) {
    if (i < 0 || i > arraysize) {
        cout << "I is invalid!" << endl;
        return false;
    } else {
        elem = elements[i];
        return true;
    }
}

bool intArray::get(int i, int &elem) {
    if (i < 0 || i > arraysize) {
        cout << "I is invalid!" << endl;
        return false;
    } else {
        elem = elements[i];
        return true;
    }
}

int intArray::length() const { return arraysize; }

void intArray::reSize(int size) {
    if (size >= 0 && size != arraysize) {
        int *newarray = new int[size];
        if (newarray == NULL)
            cerr << "Memory Allocation Error" << endl;
        int n = (size <= arraysize) ? size : arraysize;
        int *srcptr = elements;
        int *destptr = newarray;
        while (n--)*destptr++ = *srcptr++;
        delete[]elements;
        elements = newarray;
        arraysize = size;
    }
}

void intArray::print() {
    for (int i = 0; i < arraysize; i++)
        cout << elements[i] << "";
    cout << endl;
}

int main() {
/*    intArray arr(5);
    for (int i = 0; i < 5; i++)
        if (!arr.set(i, i))exit(1);
    arr.print();*/

    cout<<4064080<<endl;
    cout<<4064080<<endl;
    cout<<925973838<<endl;
    cout<<1342202160<<endl;
    cout<<1919381362<<endl;
    return 0;
}
